summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-03-08 03:14:19 +0100
committerbunnei <bunneidev@gmail.com>2023-06-03 09:05:37 +0200
commit469f0ec019752b041262acb6c704f0a822bbac65 (patch)
tree0d90c0707185a5daf807e32e84ebdff4d90cd4cc
parentandroid: Convert SettingsActivityPresenter to Kotlin (diff)
downloadyuzu-469f0ec019752b041262acb6c704f0a822bbac65.tar
yuzu-469f0ec019752b041262acb6c704f0a822bbac65.tar.gz
yuzu-469f0ec019752b041262acb6c704f0a822bbac65.tar.bz2
yuzu-469f0ec019752b041262acb6c704f0a822bbac65.tar.lz
yuzu-469f0ec019752b041262acb6c704f0a822bbac65.tar.xz
yuzu-469f0ec019752b041262acb6c704f0a822bbac65.tar.zst
yuzu-469f0ec019752b041262acb6c704f0a822bbac65.zip
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityView.kt (renamed from src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityView.java)47
1 files changed, 20 insertions, 27 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityView.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityView.kt
index 58ccf31b7..5a5c5d9cf 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityView.java
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityView.kt
@@ -1,21 +1,20 @@
-package org.yuzu.yuzu_emu.features.settings.ui;
+package org.yuzu.yuzu_emu.features.settings.ui
-import android.content.IntentFilter;
-
-import org.yuzu.yuzu_emu.features.settings.model.Settings;
-import org.yuzu.yuzu_emu.utils.DirectoryStateReceiver;
+import android.content.IntentFilter
+import org.yuzu.yuzu_emu.features.settings.model.Settings
+import org.yuzu.yuzu_emu.utils.DirectoryStateReceiver
/**
* Abstraction for the Activity that manages SettingsFragments.
*/
-public interface SettingsActivityView {
+interface SettingsActivityView {
/**
* Show a new SettingsFragment.
*
* @param menuTag Identifier for the settings group that should be displayed.
* @param addToStack Whether or not this fragment should replace a previous one.
*/
- void showSettingsFragment(String menuTag, boolean addToStack, String gameId);
+ fun showSettingsFragment(menuTag: String, addToStack: Boolean, gameId: String)
/**
* Called by a contained Fragment to get access to the Setting HashMap
@@ -24,28 +23,19 @@ public interface SettingsActivityView {
*
* @return A possibly null HashMap of Settings.
*/
- Settings getSettings();
-
- /**
- * Used to provide the Activity with Settings HashMaps if a Fragment already
- * has one; for example, if a rotation occurs, the Fragment will not be killed,
- * but the Activity will, so the Activity needs to have its HashMaps resupplied.
- *
- * @param settings The ArrayList of all the Settings HashMaps.
- */
- void setSettings(Settings settings);
+ var settings: Settings?
/**
* Called when an asynchronous load operation completes.
*
* @param settings The (possibly null) result of the ini load operation.
*/
- void onSettingsFileLoaded(Settings settings);
+ fun onSettingsFileLoaded(settings: Settings?)
/**
* Called when an asynchronous load operation fails.
*/
- void onSettingsFileNotFound();
+ fun onSettingsFileNotFound()
/**
* Display a popup text message on screen.
@@ -53,33 +43,33 @@ public interface SettingsActivityView {
* @param message The contents of the onscreen message.
* @param is_long Whether this should be a long Toast or short one.
*/
- void showToastMessage(String message, boolean is_long);
+ fun showToastMessage(message: String, is_long: Boolean)
/**
* End the activity.
*/
- void finish();
+ fun finish()
/**
* Called by a containing Fragment to tell the Activity that a setting was changed;
* unless this has been called, the Activity will not save to disk.
*/
- void onSettingChanged();
+ fun onSettingChanged()
/**
* Show loading dialog while loading the settings
*/
- void showLoading();
+ fun showLoading()
/**
* Hide the loading the dialog
*/
- void hideLoading();
+ fun hideLoading()
/**
* Show a hint to the user that the app needs the external storage to be mounted
*/
- void showExternalStorageNotMountedHint();
+ fun showExternalStorageNotMountedHint()
/**
* Start the DirectoryInitialization and listen for the result.
@@ -87,12 +77,15 @@ public interface SettingsActivityView {
* @param receiver the broadcast receiver for the DirectoryInitialization
* @param filter the Intent broadcasts to be received.
*/
- void startDirectoryInitializationService(DirectoryStateReceiver receiver, IntentFilter filter);
+ fun startDirectoryInitializationService(
+ receiver: DirectoryStateReceiver?,
+ filter: IntentFilter
+ )
/**
* Stop listening to the DirectoryInitialization.
*
* @param receiver The broadcast receiver to unregister.
*/
- void stopListeningToDirectoryInitializationService(DirectoryStateReceiver receiver);
+ fun stopListeningToDirectoryInitializationService(receiver: DirectoryStateReceiver)
}